<template>
	<view class="container">
		<view @click="goVideo(item,index)" class="cell zl-flex zl-row-between " v-for="(item,index) in list">
			<view class="cell-l zl-flex">
				<!-- <image src="/static/help.png" mode=""></image> -->
				<uni-icons type="help-filled" size="26" color="#fff" style="margin-right: 12rpx;"></uni-icons>
				<text class="zl-font-28 zl-color-white zl-font-500 zl-one-yichu">{{item.title}}</text>
			</view>
			<view class="cell-r zl-flex">
				<!-- <text class="zl-font-28 zl-color-white">教学</text> -->
				<image src="/static/my/right.png" mode=""></image>
			</view>
		</view>
		<!-- <view @click="gotxt(item.type)" class="cell zl-flex zl-row-between " v-for="(item,index) in txtlist">
			<view class="cell-l zl-flex">
				<image src="/static/help.png" mode=""></image>
				<text class="zl-font-28 zl-color-333 zl-font-500 zl-one-yichu">{{item.title}}</text>
			</view>
			<view class="cell-r zl-flex">
				<text class="zl-font-28 zl-color-666">教学</text>
				<image src="/static/to_right.png" mode=""></image>
			</view>
		</view> -->
		<view class="zl-width-100" style="height: 30rpx;"></view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				videoUrl: getApp().globalData.jiaochengUrl1,
				videoUrl1: getApp().globalData.jiaochengUrl2,
				videoUrl2: getApp().globalData.jiaochengUrl3,
				list: [{
						title: '如何创建形象克隆',
						url: "https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/",
						path:'/pages/learn/page2',
						videoContext: undefined
					},
					{
						title: '如何创建声音克隆',
						url: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/',
						path:'/pages/learn/page3',
						videoContext: undefined
					},
					{
						title: '如何创建数字人视频？',
						url: 'https://oop-zl-szr.oss-cn-hangzhou.aliyuncs.com/static/',
						path:'/pages/learn/page4',
						videoContext: undefined
					}
				],
				appid: getApp().globalData.appid,
				config: {}

				// txtlist: [{
				// 		title: '老板IP形象打造-多镜头版适合什么场景使用',
				// 		type: 1
				// 	}, {
				// 		title: '老板IP形象打造-单镜头版适合什么场景使用',
				// 		type: 13
				// 	}, {
				// 		title: '特色服务打造适合什么场景使用',
				// 		type: 2
				// 	}, {
				// 		title: '网红卡打造适合什么场景使用',
				// 		type: 3
				// 	}, {
				// 		title: '音画同步打造适合什么场景使用',
				// 		type: 4
				// 	},
				// 	// {
				// 	// 	title: '外卖餐饮打造适合什么场景使用',
				// 	// 	type: 6
				// 	// },
				// 	{
				// 		title: '品牌形象打造适合什么场景使用',
				// 		type: 7
				// 	}, {
				// 		title: '员工IP形象打造',
				// 		type: 9
				// 	},
				// ]
			};
		},
		onLoad() {
			uni.request({
				url: 'https://szrjch5.zhim123.com/audit.json?time=' + new Date().getTime(),
				success: (res) => {
					if (res.statusCode === 200) {
						console.log(res.data);
						this.config = res.data[this.appid]
					}
				}
			})
		},
		methods: {
			goVideo(item, index) {
				if (this.config.isAudit) {
					this.$util.toWebView('https://szrjch5.zhim123.com' + item.path)
				} else {
					if (index === 0) {
						this.$util.toWebView(
							`https://szrjch5.zhim123.com/pages/video/index?url=${encodeURIComponent(item.url + this.videoUrl + '.mp4')}&title=${item.title}`
						)
					} else if (index === 1) {
						this.$util.toWebView(
							`https://szrjch5.zhim123.com/pages/video/index?url=${encodeURIComponent(item.url + this.videoUrl1 + '.mp4')}&title=${item.title}`
						)
					} else if (index === 2) {
						this.$util.toWebView(
							`https://szrjch5.zhim123.com/pages/video/index?url=${encodeURIComponent(item.url + this.videoUrl2 + '.mp4')}&title=${item.title}`
						)
					}
				}
				// if (index === 0) {
				// 	uni.navigateTo({
				// 		url: `/pages/play_video/play_video?url=${item.url + this.videoUrl + '.mp4'}&title=${item.title}`
				// 	})
				// } else if (index === 1) {
				// 	uni.navigateTo({
				// 		url: `/pages/play_video/play_video?url=${item.url + this.videoUrl1 + '.mp4'}&title=${item.title}`
				// 	})
				// } else if (index === 2) {
				// 	uni.navigateTo({
				// 		url: `/pages/play_video/play_video?url=${item.url + this.videoUrl2 + '.mp4'}&title=${item.title}`
				// 	})
				// }
			},
			gotxt(type) {
				uni.navigateTo({
					url: '/LearningCourses/introduce_all?type=' + type
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	@import "css/my_bg.scss";

	.container {
		width: 750rpx;
		height: 100vh;
		background: url($bg) no-repeat;
		background-size: 100% 101%;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 30rpx 0;
		// justify-content: center;
		// padding: 0 30rpx;

		.cell {
			width: 690rpx;
			height: 100rpx;
			background: #232323;
			border-radius: 20rpx;
			margin-bottom: 30rpx;
			padding: 0 30rpx;

			.cell-l {
				image {
					width: 28rpx;
					height: 28rpx;
					margin-right: 10rpx;
				}

				text {
					width: 440rpx;
				}
			}

			.cell-r {
				image {
					width: 10rpx;
					height: 20rpx;
					margin-left: 10rpx;
				}
			}
		}
	}
</style>